package com.kaifamiao.service.Impl;

import com.kaifamiao.config.MybatisConfig;
import com.kaifamiao.mapper.JianyiModelMapper;
import com.kaifamiao.model.JianyiModel;
import com.kaifamiao.service.JianyiModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("jianyiModelServicelmpl")
@Transactional(propagation = Propagation.REQUIRED)
public class JianyiModelServicelmpl implements JianyiModelService {


    @Autowired
    private JianyiModelMapper mapper;

    @Override
    public int deleteByPrimaryKey(Long id, Long uid) {

       return mapper.deleteByPrimaryKey(id,uid);
    }

    @Override
    public int insertSelective(JianyiModel jianyi) {
        Integer uid = jianyi.getUid();
        String neirong = jianyi.getNeirong();
        jianyi.setUid(uid);
        jianyi.setNeirong(neirong);
        return mapper.insertSelective(jianyi);
    }

    @Override
    public JianyiModel selectByPrimaryKey(Long id) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(JianyiModel record) {
        return 0;
    }

    @Override
    public List<JianyiModel> selectAll() {
        return mapper.selectAll();
    }
}
